package com.app.store.service;

import com.app.store.dto.AppVersionDto;
import com.app.store.model.AppVersion;
import com.app.sysmodule.exception.ServiceException;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * Created by song on 2017/11/28.
 */
public interface StoreService {
//    /**
//     * 获取下载页
//     * @param version
//     * @return
//     */
//    Map<String,Object> getDownLoan(String version) throws ServiceException;

    AppVersionDto downInfo(String version, String type, String source) throws ServiceException;
    /**
     * 生成manifest.plist文件 返回manifest.plist路径
     */
    String generatePlistFile(String packageName, String version, String packagerUrl,String downLoadPath) throws ServiceException;

    AppVersionDto getVersion(String type, String appVersion, String serverVersion)throws ServiceException;

    /**
     * 保存数据库
     * @param version
     * @param type
     * @param fileSize
     * @param fileName
     * @return
     */
    Boolean saveAppVersion(String version, String type, String fileSize, String fileName,String isUpgrade,String serverVersion,String remark,String downFileUrl,String username) throws ServiceException;

    /**
     * 根据app类型获取最新版本app
     * @param type
     * @return
     */
    AppVersion getNewByType(String type,String source) throws ServiceException;

    /**
     * 根据size删除多余的app包
     * @param endpoint
     * @param accessKeyId
     * @param accessKeySecret
     * @param serverVersion
     * @param type
     * @param size 默认是5
     */
    void deleteOss(String endpoint, String accessKeyId, String accessKeySecret, String bucketName ,String serverVersion, String type, Integer size) throws ServiceException;

    /**
     * 获取服务端列表
     * @param source (scm)
     * @return
     */
    List<String> getServerVersionList(String source)throws ServiceException;
}
